//
//  FollowButton.swift
//  GithubUserSet
//
//  Created by Golden Jellyfish on 2025/9/2.
//

import SwiftUI

struct FollowButton: View {
    
    @ObservedObject var viewModel: UserProfileViewModel
    
    var body: some View {
        Button(action: {
            viewModel.toggleFollowStatus()
        }) {
            Text(viewModel.isFollowing ? "Unfollow" : "Follow")
                .frame(maxWidth: .infinity)
                .padding()
                .background(viewModel.isFollowing ? Color.gray : Color.blue)
                .foregroundColor(.white)
                .cornerRadius(10)
        }
        .disabled(viewModel.isFollowing)
    }
}

#Preview {
    //FollowButton()
}
